GXOpenConnection
QuickDraw GX sends theGXOpenConnection
message to establish communications with a device in preparation for sending data to it. You can override theGXOpenConnection
message to open a connection with a specific device. Your override of theGXOpenConnection
message must match the following formal declaration:
OSErr GXOpenConnection (void);
- function result
- An error code. The value
noErr
indicates that the operation was successful.DESCRIPTION
QuickDraw GX's default implementation of theGXImageJob
message sends theGXOpenConnection
message to prepare to send data to the device.The default implementation of the
GXOpenConnection
message handles PAP, Serial, and not-connected connections. It reads the resource from the communications ('comm'
) resource in the desktop printer file.You can override this message to open a connection with a specific device (such as a sheetfeeder) or to perform status checks at the time the device is opened. If you perform a status check and a failure occurs at that time, you must call the
GXCleanupOpenConnection
function.
- Note
- The default implementation of this message does not support SCSI devices.
![]()
SPECIAL CONSIDERATIONS
You never send theGXOpenConnection
message yourself.If you are implementing a nonsupported type of communications connection, you need to perform a total override of the
GXOpenConnection
message. Otherwise, you need to first forward the message and then perform status checking on the device.RESULT CODES
The default implementation of the
gxSegmentLoadFailedErr A required code segment could not be found,
or there was not enough memory to load it.gxPrUserAbortErr The user has canceled printing. GXOpenConnection
message can also return the communications errors that are listed in Table 4-2 on page 4-42.SEE ALSO
TheGXImageJob
message is described on page 4-90.You can find an example of an override of the
GXOpenConnection
message in
Listing 3-8 on page 3-30 in the chapter "Printer Drivers."The
GXCleanupOpenConnection
function is described on page 5-36 in the chapter "Printing Functions for Message Overrides."The communications (
'comm'
) resource is described in the section "The Communications ('comm') Resource" beginning on page 6-36 in the chapter "Printing Resources."
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help